#ifndef CHARACTERCLASS_H
#define CHARACTERCLASS_H


#include "dtwenty_global.h"
#include "dtwentyitem.h"
#include "dtwentyitemcontainer.h"
#include "skill.h"


class DTWENTYSHARED_EXPORT CharacterClass : public DTwentyItem
{
    Q_OBJECT

public:

    Q_INVOKABLE CharacterClass(QObject *parent = 0);
    CharacterClass(const CharacterClass& other);

    static int calcBaseBonus(int level, int category);
    static int calcSaveBonus(int level, int category);

    virtual int type() const;

    int hitDie() const;
    int skillPoints() const;
    int baseAttack() const;
    int fortSave() const;
    int refSave() const;
    int willSave() const;



protected slots:

    virtual void onInitChildren();


protected:

    int featureValue(int id) const;


};
Q_DECLARE_METATYPE(CharacterClass)


class DTWENTYSHARED_EXPORT CharacterClasses : public DTwentyItemContainer
{
    Q_OBJECT


public:

    Q_INVOKABLE CharacterClasses(QObject *parent = 0) :
        DTwentyItemContainer(parent)
    {
        registerChildType<CharacterClass>();
    }

    CharacterClasses(const CharacterClasses& other) :
        DTwentyItemContainer(other)
    {
    }

    virtual int type() const
    {
        return qMetaTypeId<CharacterClasses*>();
    }

};
Q_DECLARE_METATYPE(CharacterClasses)

#endif // CHARACTERCLASS_H
